<div id="edit-title">创建子货品</div>
<div id="main-goods-title">主货品信息</div>
<div id="main-goods-info">
	<div id="base-info">
		<div class="info-name">类目</div>
		<div class="info-text"><?php echo $mgoods['type'] ?></div>
		<div class="info-name">货号</div>
		<div class="info-text"><?php echo $mgoods['number'] ?></div>
		<div class="info-name">货品名称</div>
		<div class="info-text"><?php echo $mgoods['name'] ?></div>
		<div class="info-name">搜索码</div>
		<div class="info-text"><?php echo $mgoods['search_code'] ?></div>
	</div>
	<div id="taobao-info">
		<div class="info-name">淘宝图片</div>
		<div class="taobao-image"><img src="<?php echo $mgoods['taobao_image'] ?>" /></div>
		<div class="info-name">淘宝链接</div>
		<div class="taobao-name info-text"><a href="<?php echo $mgoods['taobao_url'] ?>" target="_blank"><?php echo $mgoods['taobao_name'] ?></a></div>
	</div>
	<div id="sub-goods-info">
		<div class="info-name">关联子货品信息</div>
		<?php foreach ($sgoods as $g) { ?>
		<div class="info-text"><a href="<?php echo $site['root'] ?>goods/update/sub/<?php echo $g->sub_goods_id ?>" target="_self"><?php echo $g->attribute; ?></a> [<?php echo $g->stock; ?>件]</div>
		<?php } ?>
	</div>
	<div class="clear"></div>
</div>
<div id="edit-sub-title">编辑子货品信息</div>
<div>
	<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="POST">
		<input type="hidden" name="rand" value="<?php echo $form['rand']; ?>" />
		<input type="hidden" name="main_goods_id" value="<?php echo $mgoods['main_goods_id']; ?>" />
		<input type="hidden" name="supplier_ids" value="" />
		<div class="edit-name">货号 <?php echo form_error('number', '<span class="error">', '</span>'); ?></div>
		<div class="edit-text"><input disabled type="text" name="number" value="<?php echo $mgoods['number'] ?>" /></div>
		<div class="edit-name">属性 <?php echo form_error('attribute', '<span class="error">', '</span>'); ?></div>
		<div class="edit-text"><input type="text" name="attribute" value="<?php echo set_value('attribute') ?>" /></div>
		<div class="edit-name">搜索代码 <?php echo form_error('search_code', '<span class="error">', '</span>'); ?></div>
		<div class="edit-text"><input type="text" name="search_code" value="<?php echo set_value('search_code') ?>" /></div>
		<div class="edit-name">已选供应商 <?php echo form_error('supplier_ids', '<span class="error">', '</span>'); ?></div>
		<div class="edit-other" id="supplier-added">
		</div>
		<div class="edit-name">选择供应商</div>
		<div class="edit-other" id="supplier-list">
			<?php foreach($suppliers as $supplier) { ?>
			<a class="supplier" value="<?php echo $supplier->supplier_id ?>"><?php echo $supplier->supplier_name ?></a>
			<?php } ?>
		</div>
		<div class="clear"></div>
		<div class="edit-submit"><input type="submit" value="创建" /></div>
	</form>
</div>
<script type="text/javascript">
$(function(){
	$('.option').bind('click', function(){form.select._click($(this))});
	$('#supplier-list .supplier').bind('click', function(){goods.addSupplier($(this))});
})
</script>